<?php
// 获取url中的id
$id = $_GET['id'];
include("conn.php");
// 连接数据库
$pdo = getConn();

$sql="select * from articles where id=:id";
// 预编译sql语句
$stmt = $pdo->prepare($sql);
$stmt->bindParam(":id", $id);
// 执行sql语句
$stmt->execute();
// 获取所有数据
$article = $stmt->fetch();
// print_r($article);
?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title><?=$article['title']?></title>
</head>
<body>
	
	<h1><?=$article['title']?></h1>
	<div>
		<?=$article['content']?>
	</div>
</body>
</html>

